j3deditor.bin.util
Class Deployer

java.lang.Object
  extended by j3deditor.bin.util.Deployer

public class Deployer
extends java.lang.Object

Utilities for manipulating with files on disk.

Author:
Risto Seene

Constructor Summary
Deployer()
           
 
Method Summary
static void createDirectory(java.io.File dir)
          Creates the specified directory and all necessary parent directories if it does not exist yet.
static void createFile(java.io.File file)
          Creates the specified file and all necessary parent directories if it does not exist yet.
static void extractZip(java.io.InputStream in, java.io.File dir)
          Extracts the contents of the specified ZIP file.
protected static java.lang.String[][] updateLanguageList(java.io.File dir)
          Returns the list of available language files from the given directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deployer

public Deployer()
Method Detail

createDirectory

public static void createDirectory(java.io.File dir)
                            throws java.lang.Exception
Creates the specified directory and all necessary parent directories if it does not exist yet.

Parameters:
dir - directory that will be created
Throws:
java.lang.Exception - if unable to create the specified directory

createFile

public static void createFile(java.io.File file)
                       throws java.lang.Exception
Creates the specified file and all necessary parent directories if it does not exist yet.

Parameters:
file - file that will be created
Throws:
java.lang.Exception - if unable to create the specified file

updateLanguageList

protected static java.lang.String[][] updateLanguageList(java.io.File dir)
                                                  throws java.lang.Exception
Returns the list of available language files from the given directory. Contains language names and two letter language codes.

Parameters:
dir - directory where the files are located
Returns:
Returns the list of available language files
Throws:
java.lang.Exception - if an exception occurs

extractZip

public static void extractZip(java.io.InputStream in,
                              java.io.File dir)
                       throws java.lang.Exception
Extracts the contents of the specified ZIP file. Can be used to extract ZIP files from a JAR file.

Parameters:
in - opened stream from a ZIP file
dir - directory where the contents will be extracted to
Throws:
java.lang.Exception - if unable to extract the specified ZIP file